package com.oozol.lieluyun.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class LoginConfiguration implements WebMvcConfigurer {
   public void addInterceptors(InterceptorRegistry registry) {
      LoginInterceptor loginInterceptor = new LoginInterceptor();
      InterceptorRegistration loginRegistry = registry.addInterceptor(loginInterceptor);
      loginRegistry.addPathPatterns(new String[]{"/**"});
      loginRegistry.excludePathPatterns(new String[]{"/login"});
      loginRegistry.excludePathPatterns(new String[]{"/loginout"});
      loginRegistry.excludePathPatterns(new String[]{"/api/login"});
      loginRegistry.excludePathPatterns(new String[]{"/api/jenkins"});
      loginRegistry.excludePathPatterns(new String[]{"/api/docker"});
      loginRegistry.excludePathPatterns(new String[]{"/favicon.ico"});
      loginRegistry.excludePathPatterns(new String[]{"/app/**"});
      loginRegistry.excludePathPatterns(new String[]{"/component/**"});
      loginRegistry.excludePathPatterns(new String[]{"/home/**"});
      loginRegistry.excludePathPatterns(new String[]{"/layuiadmin/**"});
      loginRegistry.excludePathPatterns(new String[]{"/senior/**"});
      loginRegistry.excludePathPatterns(new String[]{"/set/**"});
      loginRegistry.excludePathPatterns(new String[]{"/template/**"});
      loginRegistry.excludePathPatterns(new String[]{"/user/**"});
   }
}
